package com.thrd.taiexhibition.fragement.enterprise;

import android.os.Bundle;
import android.view.View;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.thrd.basicframework.bean.BaseFragment;
import com.thrd.basicframework.ui.recyclerview.SpacesItemDecoration;
import com.thrd.basicframework.utils.DensityUtil;
import com.thrd.taiexhibition.R;
import com.thrd.taiexhibition.adapter.InterviewAdapter;
import com.thrd.taiexhibition.bean.BeanInterview;

import java.util.List;

/**
 * 企业采访
 * @author: ${唐杰}
 * @date: 2021/3/31
 */
public class InterviewFragment extends BaseFragment {

    private List<BeanInterview> mBeanBeanInterviewList;
    private RecyclerView mRecyclerView;

    @Override
    protected int setLayoutResourceID() {
        return R.layout.fragment_interview;
    }

    @Override
    protected void setUpView(View mContentView) {
        mRecyclerView = mContentView.findViewById(R.id.rv_recyclerview);
        LinearLayoutManager manager=  new LinearLayoutManager(getMContext());
        manager.setOrientation(RecyclerView.HORIZONTAL);
        mRecyclerView.addItemDecoration(new SpacesItemDecoration(0,0, DensityUtil.dip2px(getMContext(),16),0));
        mRecyclerView.setLayoutManager(manager);
    }

    @Override
    protected void setUpData() {
        Bundle mBundle =getArguments();
        if(mBundle!=null){
            mBeanBeanInterviewList = (List<BeanInterview>) mBundle.getSerializable("BeanInterviewList");
        }
        InterviewAdapter mAdapter=new InterviewAdapter(getMContext(),mBeanBeanInterviewList);
        mRecyclerView.setAdapter(mAdapter);
    }
}
